-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use janet-simple grammar for Janet #9247
Conversation
Does squashing to a single commit and force-pushing sound ok? |
No need to manually squash, we'll squash when merging |
I don't understand this error:
I guess the line in question is this one. I think I don't see any error via Any hints as to what I might be missing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to remove the original [[language]]
block for janet. It's overriding grammar
to use the clojure
one which is causing the queries to fail (since they aren't valid for the clojure grammar)
You should see the same error printed to the log when opening a janet file. You need to run helix via |
Thanks for the hints. Looks like an extra section got added back here. I guess my bad for putting the new section elsewhere and removing the old one before the merge (^^; Sorry about that. |
(The CI failures are unrelated - it's caused by a sourcehut outage) |
* Use janet-simple grammar for Janet * Update book * Tweak language name and related * Rename janet-simple to janet in book * Remove spurious language section for janet * Drop quote_lit and qq_lit related highlighting --------- Co-authored-by: sogaiu <[email protected]> Co-authored-by: Blaž Hrastnik <[email protected]>
* Use janet-simple grammar for Janet * Update book * Tweak language name and related * Rename janet-simple to janet in book * Remove spurious language section for janet * Drop quote_lit and qq_lit related highlighting --------- Co-authored-by: sogaiu <[email protected]> Co-authored-by: Blaž Hrastnik <[email protected]>
* Use janet-simple grammar for Janet * Update book * Tweak language name and related * Rename janet-simple to janet in book * Remove spurious language section for janet * Drop quote_lit and qq_lit related highlighting --------- Co-authored-by: sogaiu <[email protected]> Co-authored-by: Blaž Hrastnik <[email protected]>
* Use janet-simple grammar for Janet * Update book * Tweak language name and related * Rename janet-simple to janet in book * Remove spurious language section for janet * Drop quote_lit and qq_lit related highlighting --------- Co-authored-by: sogaiu <[email protected]> Co-authored-by: Blaž Hrastnik <[email protected]>
* Use janet-simple grammar for Janet * Update book * Tweak language name and related * Rename janet-simple to janet in book * Remove spurious language section for janet * Drop quote_lit and qq_lit related highlighting --------- Co-authored-by: sogaiu <[email protected]> Co-authored-by: Blaž Hrastnik <[email protected]>
Following up on this comment, this PR is mostly about using the tree-sitter-janet-simple grammar for Janet support along with a syntax highligting query file.
It also adds some bits for
janet-format
-- a formatter for Janet that comes with the spork library.I am aware of 2 grammars [1] for Janet and each took a slightly different approach from the other. The one that's part of this PR is used in nvim-treesitter, difftastic, and there is code to use it from Emacs as well.
Due to historical reasons, this one is named "tree-sitter-janet-simple" (internally
janet_simple
-- to avoid name collisions) and IIUC that means the value forname
inlanguages.toml
needs to bejanet-simple
(under both[[language]]
and[[grammar]]
). Or, at least, that's what made it work for me. Please point out if that should be changed and if so how :)LSP support for Janet is still maturing and although I did get it to work with some degree of success, I didn't feel the time was right yet.
[1] Here is the other one for reference.